﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Windows.Data;

using System.Windows.Media;

using System.Windows.Media.Imaging;

using System.Windows.Controls;


namespace HA.ModFlow.Application
{
    public class VMImageConvertor : IValueConverter
    {

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            VMImageSource vm = (VMImageSource)value;


            BitmapImage bi = new BitmapImage();

            bi.BeginInit();

            switch (vm)
            {
                case VMImageSource.None:
                    bi.UriSource = new Uri(@"/HA.ModFlow.Application;component/Images/SmallIcon.png", UriKind.RelativeOrAbsolute);
                    break;
                case VMImageSource.Project:

                    bi.UriSource = new Uri(@"/HA.ModFlow.Application;component/Images/main.png", UriKind.RelativeOrAbsolute);
                    break;
                case VMImageSource.Scatter2d:
                    bi.UriSource = new Uri(@"/HA.ModFlow.Application;component/Images/scatter2d.png", UriKind.RelativeOrAbsolute);
                    break;
                case VMImageSource.Scatter2dCollection:
                    bi.UriSource = new Uri(@"/HA.ModFlow.Application;component/Images/scatter2dCollection.png", UriKind.RelativeOrAbsolute);
                    break;
                case VMImageSource.MapData:
                    bi.UriSource = new Uri(@"/HA.ModFlow.Application;component/Images/mapData.png", UriKind.RelativeOrAbsolute);
                    break;
                case VMImageSource.ConceptModel:
                    bi.UriSource = new Uri(@"/HA.ModFlow.Application;component/Images/conceptualmodel.png", UriKind.RelativeOrAbsolute);
                    break;
                case VMImageSource.Coverage:
                    bi.UriSource = new Uri(@"/HA.ModFlow.Application;component/Images/layer.png", UriKind.RelativeOrAbsolute);
                    break;
                case VMImageSource.Frame:
                    bi.UriSource = new Uri(@"/HA.ModFlow.Application;component/Images/frame.png", UriKind.RelativeOrAbsolute);
                    break;
                case VMImageSource.Grid3d:
                    bi.UriSource = new Uri(@"/HA.ModFlow.Application;component/Images/grid3d.png", UriKind.RelativeOrAbsolute);
                    break;
                case VMImageSource.Grid3dCollecion:
                    bi.UriSource = new Uri(@"/HA.ModFlow.Application;component/Images/grid3dCollecion.png", UriKind.RelativeOrAbsolute);
                    break;



                    //第二批


                case VMImageSource.modflow:
                    bi.UriSource = new Uri(@"/HA.ModFlow.Application;component/Images/modflow.png", UriKind.RelativeOrAbsolute);
                    break;


                case VMImageSource.mt3dms:
                    bi.UriSource = new Uri(@"/HA.ModFlow.Application;component/Images/mt3dms.png", UriKind.RelativeOrAbsolute);
                    break;


                case VMImageSource.dataset:
                    bi.UriSource = new Uri(@"/HA.ModFlow.Application;component/Images/dataset.png", UriKind.RelativeOrAbsolute);
                    break;


                case VMImageSource.vector:
                    bi.UriSource = new Uri(@"/HA.ModFlow.Application;component/Images/vector.png", UriKind.RelativeOrAbsolute);
                    break;


                case VMImageSource.globaloption:
                    bi.UriSource = new Uri(@"/HA.ModFlow.Application;component/Images/globaloption.png", UriKind.RelativeOrAbsolute);
                    break;


                case VMImageSource.result:
                    bi.UriSource = new Uri(@"/HA.ModFlow.Application;component/Images/result.png", UriKind.RelativeOrAbsolute);
                    break;


                    //第三批
                case VMImageSource.image:
                    bi.UriSource = new Uri(@"/HA.ModFlow.Application;component/Images/image.png", UriKind.RelativeOrAbsolute);
                    break;


                case VMImageSource.imageCollection:

                    bi.UriSource = new Uri(@"/HA.ModFlow.Application;component/Images/imageCollecion.png", UriKind.RelativeOrAbsolute);

                    break;




                default:

                    bi.UriSource = new Uri(@"/HA.ModFlow.Application;component/Images/SmallIcon.png", UriKind.RelativeOrAbsolute);

                    break;
            }

         

            bi.EndInit();

            return bi;

           
            

        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
